package org.erepublik.company.thread;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.erepublik.company.product.Food;
import org.springframework.beans.factory.ListableBeanFactory;

public class HospitalListener implements ServletContextListener  {

    public void contextDestroyed(ServletContextEvent arg0) {
    }

    public void contextInitialized(ServletContextEvent arg0) {
        System.out.println("odpalam watek updatujacy szpitale...");
        ActiveBattlesUpdater foodUpdater = new ActiveBattlesUpdater(1000*60*15);
        foodUpdater.start();
        
        HospitalUpdater hospitalUpdater = new HospitalUpdater(1000*60*5);
        hospitalUpdater.start();
    }

    
    public static void main(String[] args) {
        HospitalListener listener = new HospitalListener();
        listener.contextInitialized(null);
    }
    
}
